@import '../../../styles/base.less';

.chat-panel {
  .scrollbar();
  position: relative;
  width: 100%;
  height: 100%;
}

.chat-list {
  position: relative;
  height: calc(100% - @chat-operations-height);
  padding: 14px 0;
  line-height: 1.5;
  overflow-y: auto;
  .scrollbar();

  &.bottom-operations-active {
    height: calc(100% - @chat-operations-bottom-height);
  }

  :global(.ant-checkbox-group) {
    width: 100%;
  }
}

.chat-list__empty {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  transform: translateY(-50%);
}

.chat-item {
  display: block;
  width: 100%;
  padding: 6px 12px;

  &.checked {
    background-color: #f4f4f6;
  }
}

.chat-item-notice {
  margin-top: 4px;
  padding: 8px 16px;
  font-size: 12px;
  color: @text-color;
  background-color: #fbe9e7;
}

.chat-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.chat-item__header__nickname {
  display: block;
  height: 18px;
  font-size: 12px;
  line-height: 18px;
  color: @text-color-lighten;
}

.chat-item-anchor-tag,
.chat-item-anchor-tag__assistant {
  margin-right: 4px;
  padding: 2px 6px;
  font-size: 10px;
  border-radius: 2px;
}

.chat-item-anchor-tag__assistant {
  color: #6a3ac7;
  background-color: #f3edf9;
}

.chat-item-anchor-tag {
  color: @primary-color;
  background-color: @primary-background-color;
}

.chat-item-content {
  word-break: break-word;

  .chat-item-content__remove-button {
    transition: all 0.1s linear;
    opacity: 0;
    height: fit-content;
    padding: 0 10px;
    color: #1597ff;
  }
  &:hover {
    .chat-item-content__remove-button {
      opacity: 1;
      background: none;
    }
  }
}

.chat-item__message-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  width: 16px;
  background-color: #ffffff;
  border: 1px solid #dedede;
  border-radius: 2px;
  cursor: pointer;

  &:hover {
    background: #f4f4f6;
  }
}

.chat-operations {
  position: relative;

  &.bottom-operations-active {
    height: @chat-operations-bottom-height;
  }
}

.chat-operations__input {
  height: @chat-operations-height;
  padding: 8px 4px;
  &.hidden {
    display: none;
  }
}

.chat-operations__input__textarea {
  display: block;
  width: 100%;
  height: 58px;
  margin-bottom: 4px;
  padding: 6px 12px;
  color: @text-color-lighten;
  font-size: 12px;
  line-height: 1.5;
  background-color: #fff;
  resize: none;
  outline: none;
  border: 1px solid @divider-color;
  border-radius: 2px;

  &:disabled {
    color: #b2b7c4;
    background-color: #f4f4f6;
    border-color: #e6e7ec;
  }

  &:focus {
    border-color: @primary-color;
  }
}

.chat-operations__input__send-btn {
  float: right;
  width: 48px;
  line-height: 24px;
  font-size: 12px;
  text-align: center;
  background-color: @primary-color;
  color: #fff;
  border-radius: 2px;
  cursor: pointer;

  &:hover {
    background-color: @primary-color-hover;
  }

  &:global(.disabled) {
    color: #fcfcfd;
    background-color: #e6e7ec;
    cursor: not-allowed;
  }
}

.chat-operations__bottom {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 0;
  background-color: #ffffff;
  box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.17), inset 0 1px 0 0 #e6e7ec;
  overflow: hidden;
  transition: height 0.2s ease-in-out;

  &.active {
    display: flex;
    align-items: center;
    justify-content: center;
    height: @chat-operations-bottom-height;
  }
}

.chat-operations__bottom__close {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  position: absolute;
  right: 0;
  top: 0;
  cursor: pointer;
}

.chat-operations__bottom__button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  font-weight: 400;
  font-size: 12px;
  line-height: 18px;
  color: #3a3d48;
  letter-spacing: 0;
  cursor: pointer;

  .chat-operations__bottom__button__icon {
    margin-bottom: 6px;
    font-size: 18px;
  }
}

.chat-new-tip {
  position: absolute;
  right: 4px;
  bottom: 102px;
  width: 112px;
  padding: 6px 8px;
  text-align: center;
  color: @primary-color;
  background-color: #fff;
  border: 1px solid #e6e7ec;
  box-shadow: 0 4px 8px 0 rgba(116, 122, 140, 0.15);
  border-radius: 2px;
  cursor: pointer;
  z-index: 10;

  svg {
    margin-right: 4px;
    font-size: 16px;
    vertical-align: text-bottom;
  }
}
